home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Mousetools / FMouse / FMouse.ass < prev    next >
Text File  |  1996-09-26  |  26KB  |  1,094 lines

  1.  
  2. ; Source 55
  3. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  4. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  5. ; ­­                                                                 ­­
  6. ; ­­                FMouse V1.01  / 28.th October 1990               ­­
  7. ; ­­                                                                 ­­
  8. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  9. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  10. ; ­­                                                                 ­­
  11. ; ­­             Copyright by : Roger Fischlin                       ­­
  12. ; ­­                            Steigerwaldweg 6                     ­­
  13. ; ­­                            6450 Hanau 7                         ­­
  14. ; ­­                            Germany                              ­­
  15. ; ­­                                                                 ­­
  16. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  17. ; ­­                                                                 ­­
  18. ; ­­         Assembler : DevPac 2    / Linker : Blink                ­­
  19. ; ­­                                                                 ­­
  20. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  21. ; ­­                                                                 ­­
  22. ; ­­  THIS PROGRAM IS FREEWARE ! It may  be freely distributed if    ­­
  23. ; ­­     you do not gain any profit by using/distributing it .       ­­
  24. ; ­­                                                                 ­­
  25. ; ­­                                                                 ­­
  26. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  27.  
  28.  
  29.  
  30.     incdir    "ram:include/"
  31.     include    "exec/interrupts.i"
  32.     include    "devices/inputevent.i"
  33.     include    "devices/input.i"
  34.     include    "exec/devices.i"
  35.     include    "exec/exec_lib.i"
  36.     include    "exec/exec.i"
  37.     include    "exec/ports.i"
  38.  
  39.     include    "intuition/intuition_lib.i"
  40.     include    "intuition/intuition.i"
  41.     include    "graphics/graphics_lib.i"
  42.     include    "libraries/dos_lib.i"
  43.     include    "libraries/dos.i"
  44.     include    "libraries/dosextens.i"
  45.  
  46.     Section    "Init",CODE
  47.  
  48. FM_PORTNAME    macro
  49.     dc.b    "FMouse.Port",0
  50.     even
  51.     endm
  52.  
  53. FM_Die    equ    0
  54. FM_BlankOn    equ    1
  55. FM_BlankOff    equ    2
  56. FM_Menu    equ    3
  57. FM_NewNames    equ    4
  58. FM_Done    equ    -1
  59.  
  60. FM_Message    rsreset
  61. FMM_Message    rs.b    MN_SIZE
  62. FMM_Command    rs.b    1
  63. FMM_Data    rs.l    1
  64. FMM_SIZEOF    rs.b    0
  65.  
  66.  
  67. CALL_INT    macro
  68.     move.l    _IntuitionBase(pc),a6
  69.     jsr    _LVO\1(a6)
  70.     endm
  71. CALL_GRAF    macro
  72.     move.l    _GfxBase(pc),a6
  73.     jsr    _LVO\1(a6)
  74.     endm
  75. CALL_DOS    macro
  76.     move.l    _DOSBase(pc),a6
  77.     jsr    _LVO\1(a6)
  78.     endm
  79.  
  80. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  81. ; ­­                     startup code                       ­­
  82. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  83.  
  84. START    movem.l    d0/a0,-(sp)        ; startup code
  85.     sub.l    a1,a1
  86.     CALLEXEC    FindTask
  87.     move.l    d0,a4
  88.     tst.l    pr_CLI(a4)
  89.     beq.s    .fromWorkbench
  90.  
  91.     movem.l    (sp)+,d0/a0        ; from cli
  92.     clr.b    -1(a0,d0)        ; terminate command string with $00 byte
  93.     bra.s    .end_startup
  94.  
  95. .fromWorkbench    lea    pr_MsgPort(a4),a0
  96.     CALLEXEC     WaitPort
  97.     lea    pr_MsgPort(a4),a0
  98.     CALLEXEC     GetMsg
  99.     move.l    d0,.returnMsg
  100.  
  101.     addq.l    #8,sp
  102.     sub.l    a0,a0
  103. .end_startup    bsr.s    INSTALL        ; main code
  104.     tst.l    .returnMsg
  105.     beq.s    .exitToDOS
  106.     CALLEXEC     Forbid
  107.     move.l    .returnMsg(pc),a1
  108.     CALLEXEC     ReplyMsg
  109. .exitToDOS    moveq.l    #0,d0
  110.     rts
  111.  
  112. .returnMsg    dc.l    0
  113.  
  114. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  115. ; ­­                  Install  FMouse                       ­­
  116. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  117.  
  118. INSTALL    move.l    a0,a4
  119.     jsr    GetLibs        ; open libs
  120.     tst.l    d0
  121.     beq    .NoLibs
  122.     bsr    GetWindow        ; get output window
  123.     moveq.l    #0,d0    
  124.     cmp.l    a4,d0        ; from CLI
  125.     beq    .FromWB
  126.     tst.b    (a4)        ; empty string ?
  127.     beq    Remove        ; remove FMouse    
  128.     cmp.b    #"?",(a4)
  129.     bne    .Install_it
  130.     lea.l    .Info(pc),a0        ; print info text
  131.     bsr    CLI_Text
  132.     bsr    CloseWindow        ; close window
  133. .NoLibs    jsr    CloseLibs        ; close libs
  134.     moveq.l    #0,d0
  135.     rts
  136. .FromWB    lea.l    .WBData(pc),a4
  137.     bra    .Install_it    
  138. .WBData    dc.b    "s:FM.data",0        ; default data file if you run FMouse from WB
  139.     even
  140. .Info    dc.b    $a,"  ",$9b,"1;31;40m",$9b,"4m"
  141.     dc.b    "               FMouse V1.01/ 28th October 1990             ",$a,$a
  142.     dc.b    $9b,"0;33m"
  143.     dc.b    "                Copyright by : Roger Fischlin",$a
  144.     dc.b    "                               Steigerwaldweg 6",$a
  145.                dc.b    "                               6450 Hanau 7",$a
  146.     dc.b    "                               Germany",$a,$a
  147.     dc.b    $9b,"0;32m"
  148.     dc.b    "  FMouse is a mouse accelerator, a screen blanker and a menu.",$a
  149.     dc.b    "  It may be freely distributed if you do NOT  gain any profit",$a
  150.     dc.b    "  by using and/or distributing it.",$a,$a
  151.     dc.b    $9b,"3;31m"
  152.     dc.b    "       Usage : FMouse <data file>      to install FMouse",$a
  153.     dc.b    "               FMouse ?                to get this text",$a
  154.     dc.b    "               FMouse                  to remove FMouse",$a,$a
  155.     dc.b    $9b,"0;31;40m"
  156.     dc.b    0
  157.     even
  158.  
  159. .Install_it    move.l    a4,a0
  160.     bsr    ReadData        ; read data file
  161.     tst.l    d0
  162.     bmi    .Quit        ; error ...
  163.  
  164.     CALLEXEC    Forbid        ; FMouse already installed ?
  165.     lea.l    FMousePortName,a1
  166.     CALLEXEC    FindPort
  167.     tst.l    d0
  168.     bne    .Already
  169.     lea.l    START-4,a0        ; create own task
  170.     move.l    (a0),d3
  171.     clr.l    (a0)
  172.     move.l    #ProcessName,d1
  173.     moveq.l    #0,d2
  174.     move.l    #2000,d4
  175.     CALLDOS    CreateProc
  176.     CALLEXEC    Permit
  177.     lea.l    .InstallText(pc),a0
  178.     bsr    CLI_Text
  179.     bsr    CloseWindow        ; close window
  180.     rts
  181.  
  182. .InstallText    dc.b    $9b,"1;33m"
  183.     dc.b    "FMouse V1.01"
  184.     dc.b    $9b,"0;31m"," installed.",$a
  185.     dc.b    "FMouse © Roger Fischlin. This program is FREEWARE !.",$a,0
  186.  
  187. .Already    move.l    d0,d5        ; msg for new data file
  188.     sub.l    a1,a1        ; get task
  189.     CALLEXEC    FindTask
  190.     move.l    d0,d2
  191.     moveq.l    #-1,d0        ; get signal
  192.     CALLEXEC    AllocSignal
  193.     tst.l    d0
  194.     bmi    .Error
  195.     lea.l    .Port(pc),a1        ; init port
  196.     move.b    #PA_SIGNAL,MP_FLAGS(a1)
  197.     move.l    d2,MP_SIGTASK(a1)
  198.     move.b    d0,MP_SIGBIT(a1)
  199.     clr.l    LN_NAME(a1)
  200.     move.b    #NT_MSGPORT,LN_TYPE(a1)
  201.  
  202.     lea.l    .Message(pc),a1
  203.     move.w    #FMM_SIZEOF-1,d1
  204. .Loop1    clr.b    (a1)+
  205.     dbra    d1,.Loop1
  206.     lea.l    .Message(pc),a1
  207.     move.b    #NT_MESSAGE,LN_TYPE(a1)
  208.     lea.l    .Port(pc),a0
  209.     move.l    a0,MN_REPLYPORT(a1)
  210.     move.w    #FMM_SIZEOF,MN_LENGTH(a1)
  211.     move.b    #FM_NewNames,FMM_Command(a1)
  212.     move.l    d5,a0
  213.     CALLEXEC    PutMsg
  214.     lea.l    .Port(pc),a0        ; wait for reply
  215.     CALLEXEC    WaitPort
  216.     lea.l    .Port(pc),a0
  217.     CALLEXEC    GetMsg
  218.  
  219.     lea.l    .Port(pc),a1        ; free signal
  220.     moveq.l    #0,d0
  221.     move.b    MP_SIGBIT(a1),d0
  222.     CALLEXEC    FreeSignal
  223. .Error    CALLEXEC    Permit
  224. .Quit    bra    CloseWindow        ; close window
  225.  
  226. .Port    dcb.b    MP_SIZE,0
  227.     even
  228. .Message    dcb.b    FMM_SIZEOF,0
  229.     even
  230.  
  231. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  232. ; ­­                  Remove  FMOUSE                        ­­
  233. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  234.  
  235. Remove    CALLEXEC    Forbid
  236.     lea.l    FMousePortName,a1    ; FMouse installed ????
  237.     CALLEXEC    FindPort
  238.     move.l    d0,d5
  239.     beq    .NotFound
  240.     sub.l    a1,a1        ; get task
  241.     CALLEXEC    FindTask
  242.     move.l    d0,d2
  243.     moveq.l    #-1,d0        ; get signal
  244.     CALLEXEC    AllocSignal
  245.     tst.l    d0
  246.     bmi    .Error
  247.  
  248.     lea.l    .DiePort(pc),a1    ; init port
  249.     move.b    #PA_SIGNAL,MP_FLAGS(a1)
  250.     move.l    d2,MP_SIGTASK(a1)
  251.     move.b    d0,MP_SIGBIT(a1)
  252.     clr.l    LN_NAME(a1)
  253.     move.b    #NT_MSGPORT,LN_TYPE(a1)
  254.  
  255.     lea.l    .Message(pc),a1
  256.     move.w    #FMM_SIZEOF-1,d1
  257. .Loop1    clr.b    (a1)+
  258.     dbra    d1,.Loop1
  259.     lea.l    .Message(pc),a1
  260.     move.b    #NT_MESSAGE,LN_TYPE(a1)
  261.     lea.l    .DiePort(pc),a0
  262.     move.l    a0,MN_REPLYPORT(a1)
  263.     move.w    #FMM_SIZEOF,MN_LENGTH(a1)
  264.     move.b    #FM_Die,FMM_Command(a1)
  265.     move.l    d5,a0
  266.     CALLEXEC    PutMsg
  267.     lea.l    .DiePort(pc),a0    ; wait for reply
  268.     CALLEXEC    WaitPort
  269.     lea.l    .DiePort(pc),a0
  270.     CALLEXEC    GetMsg
  271.     lea.l    .DiePort(pc),a1    ; free signal
  272.     moveq.l    #0,d0
  273.     move.b    MP_SIGBIT(a1),d0
  274.     CALLEXEC    FreeSignal
  275.     CALLEXEC    Permit
  276.     lea.l    .RemovedText(pc),a0
  277.     bsr    CLI_Text
  278.     bra    CloseWindow        ; close window
  279. .RemovedText    dc.b    "FMouse removed.",$a,0
  280.     even
  281. .Error    CALLEXEC    Permit
  282.     lea.l    .ErrorText(pc),a0
  283.     bsr    CLI_Text
  284.     bra    CloseWindow        ; close window
  285. .ErrorText    dc.b    "AllocSignal failed !!!!",$a,0
  286.     even
  287.  
  288. .NotFound    CALLEXEC    Permit
  289.     lea.l    .NotFText(pc),a0
  290.     bsr    CLI_Text
  291.     bra    CloseWindow        ; close window
  292. .NotFText    dc.b    "FMouse not installed.",$a,0
  293.     even
  294.  
  295. .DiePort    dcb.b    MP_SIZE,0
  296.     even
  297. .Message    dcb.b    FMM_SIZEOF,0
  298.     even
  299.  
  300.  
  301. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  302. ; ­­                       write text (^a0)                 ­­
  303. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  304.  
  305. CLI_Text    move.l    a0,d2
  306.     moveq.l    #-1,d3        ; get length
  307. .Label    addq.l    #1,d3
  308.     tst.b    (a0)+
  309.     bne.s    .Label
  310.     move.l    CONWINDOW(pc),d1
  311.     bne.s    .WB
  312.     CALLDOS    Output        ; get handle to CLI window
  313.     move.l    d0,d1
  314. .WB    CALLDOS    Write
  315.     rts
  316.  
  317. CONWINDOW    dc.l    0
  318.  
  319. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  320. ; ­­                       GetWindow                        ­­
  321. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  322.  
  323. GetWindow    clr.l    CONWINDOW
  324.     sub.l    a1,a1        ; if we run from Workbench
  325.     CALLEXEC    FindTask        ; a RAW window muszt be opened
  326.     move.l    d0,a0        ; otherwise we'll use the CLI window    
  327.     tst.l    pr_CLI(a0)
  328.     bne.s    .fromCLI
  329.     lea.l    .Name(pc),a0
  330.     move.l    a0,d1
  331.     move.l    #MODE_NEWFILE,d2
  332.     CALLDOS    Open
  333.     move.l    d0,CONWINDOW
  334. .fromCLI    rts
  335.  
  336. .Name    dc.b    "RAW:20/20/600/90/FMouse",0
  337.     even
  338.  
  339. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  340. ; ­­                     CloseWindow                        ­­
  341. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  342.  
  343. CloseWindow    move.l    CONWINDOW(pc),d1
  344.     beq.s    .fromCLI
  345.     lea.l    .ExitText(pc),a0    ; wait for RETURN to close window
  346.     bsr    CLI_Text
  347.     move.l    CONWINDOW(pc),d1
  348.     lea.l    .Buffer(pc),a0
  349.     move.l    a0,d2
  350.     moveq.l    #1,d3
  351.     CALLDOS    Read
  352.     move.l    CONWINDOW(pc),d1    ; if a RAWwindow was opened , close it !
  353.     CALLDOS    Close
  354. .fromCLI    rts
  355. .Buffer    ds.b    2
  356.     even
  357. .ExitText    dc.b    $a,"Press any key.",0
  358.     even
  359.  
  360. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  361. ; ­­                     read data file                     ­­
  362. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  363.  
  364. ReadData    move.l    a0,d1
  365.     cmp.b    #'"',(a0)        ; file name in marks
  366.     bne.s    .No
  367.     addq.l    #1,a0
  368.     addq.l    #1,d1
  369. .Label1    move.b    (a0)+,d0
  370.     beq.s    .No
  371.     cmp.b    #'"',d0
  372.     bne.s    .Label1
  373.     clr.b    -1(a0)
  374. .No    move.l    #MODE_OLDFILE,d2
  375.     CALLDOS    Open        ; open data file
  376.     move.l    d0,d4
  377.     beq.s    .NotFound
  378.     move.l    d0,d1
  379.     move.l    #SPEED,d2
  380.     move.l    #ENDE-SPEED,d3
  381.     CALLDOS    Read        ; read data
  382.     cmp.l    d0,d3
  383.     bne.s    .ReadError
  384.     move.l    d4,d1
  385.     CALLDOS    Close
  386.     CALLEXEC    Forbid
  387.     lea.l    FMousePortName,a1    ; FMouse installed ????
  388.     CALLEXEC    FindPort        ; if FMouse already exists
  389.     move.l    d0,a0        ; new data must be copied
  390.     tst.l    d0
  391.     beq    .Label4
  392.     lea.l    SPEED,a1
  393.     lea.l    SPEED-FMousePort(a0),a0
  394.     move.w    #ENDE-SPEED-1,d0    ; copy data
  395. .Loop    move.b    (a1)+,(A0)+
  396.     dbra    d0,.Loop
  397. .Label4    CALLEXEC    Permit
  398.     moveq.l    #0,d0
  399.     rts
  400.  
  401.  
  402. .ReadError    move.l    d4,d1
  403.     CALLDOS    Close
  404.     lea.l    .ReadErrorText(pc),a0    ; write error messages
  405. .Label3    bsr    CLI_Text
  406.     moveq.l    #-1,d0
  407.     rts
  408. .NotFound    lea.l    .NotFoundText(pc),a0
  409.     bra.s    .Label3
  410. .ReadErrorText    dc.b    "ERROR : Read error !",$a,0
  411.     even
  412. .NotFoundText    dc.b    "ERROR : File not found !",$a,0
  413.     Even
  414.  
  415. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  416. ; ­­                          FMOUSE                        ­­
  417. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  418.     Section    "FMouse",CODE
  419.  
  420. FMOUSE    clr.l    Timer        ; clear counter
  421.     clr.l    ScreenPointer
  422.  
  423.     sub.l    a1,a1
  424.     CALLEXEC    FindTask
  425.  
  426.     lea.l    ReplyPort(pc),a1    ; init port
  427.     move.l    d0,MP_SIGTASK(a1)
  428.  
  429.     lea.l    IOReq(pc),a1        ; open input-device
  430.     lea.l    Name(pc),a0
  431.     moveq.l    #0,d0
  432.     moveq.l    #0,d1
  433.     CALLEXEC    OpenDevice
  434.     tst.l    d0
  435.     bne    CloseDevice
  436.  
  437.     bsr    InitPort        ; get FMouse port
  438.     tst.l    d0
  439.     bne    CloseDevice
  440.     
  441.     lea.l    Interrupt(pc),a0
  442.     lea.l    IR_Code(pc),a1
  443.     move.l    a1,IS_CODE(a0)
  444.     move.b    #51,LN_PRI(a0)
  445.     lea.l    HandlerName(pc),a1
  446.     move.l    a1,LN_NAME(a0)
  447.     clr.l    IS_DATA(a0)
  448.     
  449.     lea.l    IOReq(pc),a1
  450.     move.l    a0,IO_DATA(a1)
  451.     lea.l    ReplyPort(pc),a0
  452.     move.l    a0,MN_REPLYPORT(a1)
  453.     move.w    #IND_ADDHANDLER,IO_COMMAND(a1)
  454.     CALLEXEC    DoIO
  455.  
  456. WaitForMsg    lea.l    FMousePort(pc),a0
  457.     CALLEXEC    WaitPort
  458.     lea.l    FMousePort(pc),a0
  459.     CALLEXEC    GetMsg
  460.     tst.l    d0
  461.     beq.s    WaitForMsg
  462.     move.l    d0,a3
  463.     CALLEXEC    Disable        ; NO interruption now !
  464.     move.l    a3,a1
  465.     moveq.l    #0,d2
  466.     move.b    FMM_Command(a1),d2
  467.     move.b    #FM_Done,FMM_Command(a1)
  468.     CALLEXEC    Enable
  469.     move.l    a3,a1
  470.     CALLEXEC    ReplyMsg        ; reply msg
  471.  
  472.     cmp.b    #FM_NewNames,d2    ; which command
  473.     beq.s    .DoNewNames
  474.  
  475.     cmp.b    #FM_Die,d2        ; which command
  476.     beq.s    Die
  477.     cmp.b    #FM_Menu,d2
  478.     beq    .DoMenu
  479.     cmp.b    #FM_BlankOn,d2
  480.     beq    .DoBlankOn
  481.     cmp.b    #FM_BlankOff,d2
  482.     beq    .DoBlankOff
  483.     bra.s    WaitForMsg
  484.  
  485. .DoMenu    bsr    _Menu        ; execute command and return
  486.     bra    WaitForMsg
  487. .DoBlankOn    bsr    BlankOn
  488.     bra    WaitForMsg
  489. .DoBlankOff    bsr    BlankOff
  490.     bra    WaitForMsg
  491. .DoNewNames    clr.l    Timer
  492.     bra    WaitForMsg
  493.  
  494. Die    lea.l    IOReq(pc),a1        ; bye, bye ....
  495.     lea.l    Interrupt(pc),a0
  496.     move.l    a0,IO_DATA(a1)
  497.     move.w    #IND_REMHANDLER,IO_COMMAND(a1)
  498.     CALLEXEC    DoIO
  499.  
  500. DeletePort    bsr    FreePort
  501.     
  502. CloseDevice    lea.l    IOReq(pc),a1
  503.     CALLEXEC    CloseDevice
  504. NoDevice    bsr    CloseLibs
  505.     moveq.l    #0,d0
  506.     rts
  507.  
  508. ProcessName    dc.b    "FMouse.Task",0
  509.     even
  510.  
  511. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  512. ; ­­                     Get Libraries                      ­­
  513. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  514.  
  515. GetLibs    lea.l    IntName(pc),a1        ; open libraries
  516.     moveq.l    #33,d0
  517.     CALLEXEC    OpenLibrary
  518.     move.l    d0,_IntuitionBase
  519.     beq.s    .Error
  520.     lea.l    DosName(pc),a1
  521.     moveq.l    #33,d0
  522.     CALLEXEC    OpenLibrary
  523.     move.l    d0,_DOSBase
  524.     beq.s    .Error
  525.     lea.l    GfxName(pc),a1
  526.     moveq.l    #33,d0
  527.     CALLEXEC    OpenLibrary
  528.     move.l    d0,_GfxBase
  529. .Error    rts
  530.  
  531. _IntuitionBase    dc.l    0
  532. _GfxBase    dc.l    0
  533. _DOSBase    dc.l    0
  534.  
  535. IntName    INTNAME
  536. DosName    DOSNAME
  537. GfxName    GRAFNAME
  538.  
  539. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  540. ; ­­                   Close Libraries                      ­­
  541. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  542.  
  543. CloseLibs    move.l    d2,-(sp)
  544.     moveq.l    #0,d2        ; close Libraries
  545.     move.l    _IntuitionBase(pc),a1
  546.     cmp.l    a0,d5
  547.     beq.s    .Skip1
  548.     CALLEXEC    CloseLibrary
  549. .Skip1    move.l    _DOSBase(pc),a1
  550.     cmp.l    a0,d5
  551.     beq.s    .Skip2
  552.     CALLEXEC    CloseLibrary
  553. .Skip2    move.l    _GfxBase(pc),a1
  554.     cmp.l    a0,d5
  555.     beq.s    .Skip3
  556.     CALLEXEC    CloseLibrary
  557. .Skip3    move.l    (sp)+,d2
  558.     rts
  559.     
  560. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  561. ; ­­                   Init FMousePort                      ­­
  562. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  563.  
  564. InitPort    sub.l    a1,a1        ; get task
  565.     CALLEXEC    FindTask
  566.     move.l    d0,d2
  567.     moveq.l    #-1,d0        ; get signal
  568.     CALLEXEC    AllocSignal
  569.     tst.l    d0
  570.     bmi.s    .Error
  571.  
  572.     lea.l    FMousePort(pc),a1    ; init port
  573.     move.b    #PA_SIGNAL,MP_FLAGS(a1)
  574.     move.l    d2,MP_SIGTASK(a1)
  575.     move.b    d0,MP_SIGBIT(a1)
  576.     lea.l    FMousePortName(pc),a0
  577.     move.l    a0,LN_NAME(a1)
  578.     move.b    #NT_MSGPORT,LN_TYPE(a1)
  579.     CALLEXEC    AddPort        ; add port
  580.     moveq.l    #0,d0
  581. .Error    rts
  582.  
  583. FMousePortName    FM_PORTNAME
  584.     even
  585.  
  586. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  587. ; ­­                       Free Port                        ­­
  588. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  589.  
  590. FreePort    lea.l    FMousePort(pc),a1    ; remove port
  591.     CALLEXEC    RemPort
  592.     lea.l    FMousePort(pc),a1    ; free signal
  593.     moveq.l    #0,d0
  594.     move.b    MP_SIGBIT(a1),d0
  595.     CALLEXEC    FreeSignal
  596.     rts
  597.  
  598.  
  599. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  600. ; ­­                       open Screen                      ­­
  601. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  602.  
  603. BlankOn    tst.l    ScreenPointer
  604.     bne.s    .Already
  605.     move.l    a0,-(sp)        ; open black screen as blank.
  606.     lea.l    .ScreenData(pc),a0
  607.     CALL_INT    OpenScreen
  608.     move.l    d0,ScreenPointer
  609.     beq.s    .NoScreen
  610.     move.l    d0,a0
  611.     lea.l    sc_ViewPort(a0),a0
  612.     move.l    a0,a3
  613.     moveq.l    #0,d0        ; set screen color to black
  614.     moveq.l    #0,d1
  615.     moveq.l    #0,d2
  616.     moveq.l    #0,d3
  617.     CALL_GRAF    SetRGB4
  618.     move.l    a3,a0
  619.     moveq.l    #1,d0
  620.     moveq.l    #0,d1
  621.     moveq.l    #0,d2
  622.     moveq.l    #0,d3
  623.     CALL_GRAF    SetRGB4
  624.  
  625.     move.l    a3,a0        ; set pointer color to black
  626.     moveq.l    #17,d0
  627.     moveq.l    #0,d1
  628.     moveq.l    #0,d2
  629.     moveq.l    #0,d3
  630.     CALL_GRAF    SetRGB4
  631.     move.l    a3,a0
  632.     moveq.l    #18,d0
  633.     moveq.l    #0,d1
  634.     moveq.l    #0,d2
  635.     moveq.l    #0,d3
  636.     CALL_GRAF    SetRGB4
  637.     move.l    a3,a0
  638.     moveq.l    #19,d0
  639.     moveq.l    #0,d1
  640.     moveq.l    #0,d2
  641.     moveq.l    #0,d3
  642.     CALL_GRAF    SetRGB4
  643. .NoScreen    move.l    (sp)+,a0
  644. .Already    rts    
  645.  
  646. .ScreenData    dc.w    0,0
  647.     dc.w    64,20
  648.     dc.w    1
  649.     dc.b    -1,-1
  650.     dc.w    0,CUSTOMSCREEN!SCREENQUIET
  651.     dc.l    0,0,0,0
  652. ScreenPointer    dc.l    0
  653.  
  654. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  655. ; ­­                      close Screen                      ­­
  656. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  657.  
  658. BlankOff    move.l    ScreenPointer(pc),d0
  659.     beq.s    .NoScreen
  660.     move.l    a0,-(sp)
  661.     move.l    d0,a0
  662.     CALL_INT    CloseScreen
  663.     clr.l    ScreenPointer
  664.     move.l    (sp)+,a0
  665. .NoScreen    rts
  666.  
  667.  
  668. Interrupt    dcb.b    IS_SIZE,0
  669.     even
  670. Name    dc.b    "input.device",0
  671.     even
  672. ReplyPort    dcb.b    MP_SIZE,0
  673.     even
  674. IOReq    dcb.b    IOSTD_SIZE,0
  675.     even
  676. Timer    dc.l    0
  677.  
  678. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  679. ; ­­                      Handler code                      ­­
  680. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  681.  
  682. IR_Code    movem.l    d0-d7/a0-a6,-(sp)
  683.  
  684. .Loop    cmp.b    #IECLASS_NULL,ie_Class(a0)        ; skip emtpy event
  685.     beq    .Next
  686.     cmp.b    #IECLASS_RAWMOUSE,ie_Class(a0)    ; mouse event !
  687.     beq.s    .RawMouse
  688.     cmp.b    #IECLASS_RAWKEY,ie_Class(a0)        ; key event !
  689.     beq.s    .RawKey
  690.     cmp.b    #IECLASS_TIMER,ie_Class(a0)        ; timer event !
  691.     bne    .Screen            ; else : remove blank
  692.  
  693. .Tick    addq.l    #1,Timer            ; add timer
  694.     move.l    Timer(pc),d0            ; reached time for blanking ?
  695.     cmp.l    Time(pc),d0
  696.     bne    .Next
  697.     
  698.     moveq.b    #FM_BlankOn,d0            ; send msg for blanking
  699.     bsr    .MailMessage
  700.     bra    .Next            ; check next event
  701.  
  702. .RawMouse    moveq.l    #0,d0            ; RawMouse Event
  703.     move.w    ie_X(a0),d0            ; increase mouse move
  704.     muls    SPEED(pc),d0
  705.     move.w    d0,ie_X(a0)
  706.  
  707.     moveq.l    #0,d0
  708.     move.w    ie_Y(a0),d0
  709.     muls    SPEED(pc),d0
  710.     move.w    d0,ie_Y(a0)
  711.     bra.s    .Screen            ; remove blank
  712.  
  713. .RawKey    cmp.w    #$5f,ie_Code(a0)        ; HELP key ?
  714.     bne.s    .Screen
  715.     move.w    ie_Qualifier(a0),d0
  716.     and.w    #IEQUALIFIER_RCOMMAND,d0
  717.     cmp.w    #IEQUALIFIER_RCOMMAND,d0
  718.     bne.s    .Screen
  719.     move.w    #IECLASS_NULL,ie_Class(a0)        ; remove Input Event
  720.     
  721.     moveq.b    #FM_Menu,d0
  722.     bsr    .MailMessage
  723.  
  724. .Screen    clr.l    Timer            ; remove blank if there's one 
  725.     tst.l    ScreenPointer
  726.     beq.s    .Next            ; no blank !
  727.     moveq.b    #FM_BlankOff,d0
  728.     bsr    .MailMessage
  729.  
  730. .Next    move.l    ie_NextEvent(a0),a0        ; check next event
  731.     cmp.l    #0,a0
  732.     bne    .Loop
  733. .Exit    movem.l    (sp)+,d0-d7/a0-a6
  734.     move.l    a0,d0
  735.     rts
  736.  
  737. ; prepare message
  738.  
  739. .MailMessage    move.l    a0,-(sp)        ; clear structure
  740.  
  741.     lea.l    .Message(pc),a1
  742.     cmp.b    #FM_Done,FMM_Command(a1)    ; If last message wasn't used skip msgs
  743.     bne.s    .Skip
  744.  
  745.     moveq.l    #FMM_SIZEOF-1,d1
  746. .Label    clr.b    (a1)+
  747.     dbra    d1,.Label
  748.  
  749.     lea.l    .Message(pc),a1    ; init structure
  750.     move.b    #NT_FREEMSG,LN_TYPE(a1)
  751.     move.w    #FMM_SIZEOF,MN_LENGTH(a1)
  752.     move.b    d0,FMM_Command(a1)
  753.     lea.l    FMousePort(pc),a0
  754.     CALLEXEC    PutMsg        ; mail message
  755.     
  756. .Skip    move.l    (sp)+,a0
  757.     rts
  758.  
  759. .Message    dcb.b    FMM_SIZEOF,FM_Done
  760.     even
  761. HandlerName    dc.b    "FMouse.Handler",0
  762.     even
  763.  
  764.  
  765. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  766. ; ­­                          Menu                          ­­
  767. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  768.  
  769. _Menu    CALL_INT    WBenchToFront
  770.     bsr    .RestoreGadgets    ; restore gadget positions
  771.     lea.l    .WindowData(pc),a0    ; open window
  772.     CALL_INT    OpenWindow
  773.     move.l    d0,.WindowPointer
  774.     beq    .Error
  775.  
  776.     bsr    .AdjustGadgets        ; adjust gadgets to border sizes
  777.  
  778.     move.l    .WindowPointer(pc),a0
  779.     lea.l    .Gadget1(pc),a1
  780.     moveq.l    #0,d0
  781.     moveq.l    #10,d1
  782.     sub.l    a2,a2
  783.     CALL_INT    AddGList
  784.  
  785.     
  786. .NewNames    move.l    .WindowPointer(pc),a1    ; set pen #1
  787.     move.l    wd_RPort(a1),a1
  788.     move.l    a1,a2
  789.     moveq.l    #1,d0
  790.     CALL_GRAF    SetAPen
  791.  
  792.     move.l    a2,a1        ; draw rectangle
  793.     move.l    .WindowPointer(pc),a0            
  794.     moveq.l    #0,d0
  795.     moveq.l    #0,d1
  796.     move.w    wd_Width(a0),d2
  797.     move.w    wd_Height(a0),d3
  798.     subq.l    #1,d2
  799.     subq.l    #1,d3
  800.     add.b    wd_BorderLeft(a0),d0
  801.     add.b    wd_BorderTop(a0),d1
  802.     sub.b    wd_BorderRight(a0),d2
  803.     sub.b    wd_BorderBottom(a0),d3
  804.     CALL_GRAF    RectFill
  805.     bsr    .PrintNames        ; write names
  806.  
  807. .wait    CALLEXEC    Forbid
  808.     
  809.     move.l    .WindowPointer(pc),a0    ; wait for messages
  810.     move.l    wd_UserPort(a0),a0
  811.     CALLEXEC    GetMsg        ; already msg ?
  812.     tst.l    d0
  813.     beq.s    .CheckPort2
  814.     move.l    d0,d2
  815.     CALLEXEC    Permit
  816.     move.l    d2,d0
  817.     bra    .WindowMsg2    
  818.  
  819. ; check 2nd port 
  820.  
  821. .CheckPort2    lea.l    FMousePort(pc),a0
  822.     CALLEXEC    GetMsg        ; already msg ?
  823.     tst.l    d0
  824.     beq    .WaitPorts
  825.     move.l    d0,d2
  826.     CALLEXEC    Permit
  827.     move.l    d2,d0
  828.     bra.s    .FMouseMsg2
  829.  
  830. .WaitPorts    move.l    .WindowPointer(pc),a0
  831.     move.l    wd_UserPort(a0),a0
  832.     move.b    MP_SIGBIT(a0),d1
  833.     move.b    FMousePort+MP_SIGBIT(pc),d2
  834.     moveq.l    #0,d0
  835.     moveq.l    #0,d3
  836.     bset    d1,d0
  837.     bset    d2,d0
  838.     bset    d2,d3
  839.     CALLEXEC    Wait
  840.     cmp.l    d0,d3        ; Which port : FMousePort ?
  841.     bne    .WindowMsg
  842.  
  843. ; Msg from FMouse
  844.  
  845. .FMouseMsg    CALLEXEC    Permit
  846.     lea.l    FMousePort(pc),a0
  847.     CALLEXEC    GetMsg
  848. .FMouseMsg2    tst.l    d0
  849.     beq    .wait
  850.     move.l    d0,a3
  851.     CALLEXEC    Disable        ; NO interruption now !
  852.     move.l    a3,a1
  853.     moveq.l    #0,d2
  854.     move.b    FMM_Command(a1),d2
  855.     move.b    #FM_Done,FMM_Command(a1)
  856.     CALLEXEC    Enable
  857.     move.l    a3,a1
  858.     CALLEXEC    ReplyMsg        ; reply msg
  859.  
  860.     cmp.b    #FM_NewNames,d2
  861.     beq    .DoNewNames        ; redraw window
  862.     
  863.     cmp.b    #FM_Die,d2        ; close window and remove handler
  864.     beq.s    .DoDie
  865.     cmp.b    #FM_BlankOn,d2        ; get blank
  866.     beq    .DoBlankOn
  867.     cmp.b    #FM_BlankOff,d2    ; remove blank
  868.     beq    .DoBlankOff
  869.     bra    .wait
  870. .DoNewNames    clr.l    Timer
  871.     bra    .NewNames    
  872. .DoBlankOn    bsr    BlankOn
  873.     bra    .wait
  874. .DoBlankOff    bsr    BlankOff
  875.     bra    .wait
  876. .DoDie    move.l    .WindowPointer(pc),a0    ; close window
  877.     CALL_INT    CloseWindow        ; and die ....
  878.     addq.l    #4,SP        ; skip return address
  879.     bra    Die
  880.  
  881. ; Msg from window port
  882.  
  883. .WindowMsg    CALLEXEC    Permit
  884.     move.l    .WindowPointer(pc),a0    ; wait for message 
  885.     move.l    wd_UserPort(a0),a0
  886.     CALLEXEC    GetMsg        ; get it !
  887. .WindowMsg2    move.l    d0,a1
  888.     move.w    im_Code(a1),d2
  889.     move.l    im_Class(a1),d3
  890.     move.l    im_IAddress(a1),a2
  891.     CALLEXEC    ReplyMsg        ; reply it !
  892.     cmp.l    #CLOSEWINDOW,d3    ; close window
  893.     beq.s    .Exit
  894.     cmp.l    #VANILLAKEY,d3
  895.     beq.s    .Key
  896.     move.w    gg_GadgetID(a2),d2    ; get GadgetID (contains equal ASCII code)
  897. .Key    cmp.b    #"0",d2
  898.     bne.s    .label6
  899.     add.b    #10,d2
  900. .label6    sub.b    #"1",d2
  901.     cmp.b    #9,d2        ; no number key ?
  902.     bhi    .wait
  903.     bne.s    .Load        ; else execute file
  904.     
  905. .Exit    move.l    .WindowPointer(pc),a0    ; close window
  906.     CALL_INT    CloseWindow
  907.     
  908. .Error    rts
  909.  
  910. .Load    move.l    d2,d1        ; execute command
  911.     moveq.l    #15,d0        ; get command string
  912.     and.l    d0,d1
  913.     move.l    d1,d2
  914.     lsl.w    #5,d1        ; mulu (32+64)
  915.     lsl.w    #6,d2
  916.     add.w    d2,d1
  917.     lea.l    LISTE+32(pc),a1
  918.     add.l    a1,d1
  919.     move.l    d1,d5
  920.  
  921.     move.l    .WindowPointer(pc),a0    ; close window
  922.     CALL_INT    CloseWindow
  923.  
  924.     lea.l    .NILName(pc),a0    ; open NIL:
  925.     move.l    a0,d1
  926.     move.l    #MODE_NEWFILE,d2
  927.     CALLDOS    Open
  928.     move.l    d0,d2
  929.     move.l    d0,d3
  930.     beq.s    .NoNIL
  931.     move.l    d5,d1
  932.     CALLDOS    Execute        ; execute command
  933.     move.l    d3,d1
  934.     CALLDOS    Close        ; close NIL:
  935. .NoNIL    rts    
  936.     
  937. .NILName    dc.b    "NIL:",0
  938.     even    
  939.  
  940.  
  941. .PrintNames    lea.l    LISTE(pc),a3        ; type names
  942.     move.l    .WindowPointer(pc),a4
  943.     move.l    wd_RPort(a4),a2
  944.     move.l    a2,a1
  945.     moveq.l    #0,d0
  946.     CALL_GRAF    SetAPen        ; set pen and draw mode
  947.     move.l    a2,a1
  948.     moveq.l    #RP_JAM1,d0
  949.     CALL_GRAF    SetDrMd
  950.     moveq.l    #0,d6
  951.  
  952. .Label1    move.l    a2,a1        ; get x,y
  953.     move.l    d6,d1
  954.     mulu    #10,d1
  955.     moveq.l    #4,d0
  956.     add.b    wd_BorderLeft(a4),d0
  957.     add.b    wd_BorderTop(a4),d1
  958.     add.w    rp_TxBaseline(a1),d1
  959.     addq.l    #1,d1
  960.     CALL_GRAF    Move
  961.     move.l    a3,a0        ; get length
  962.     moveq.l    #-1,d0
  963. .Label2    addq.l    #1,d0
  964.     tst.b    (a0)+
  965.     bne.s    .Label2
  966. .Label3    move.l    a2,a1
  967.     tst.l    d0
  968.     beq.s    .Label4
  969.     move.l    a3,a0
  970.     CALL_GRAF    Text        ; write text
  971. .Label4    lea.l    (32+64)(a3),a3        ; skip name and dos command
  972.     addq.l    #1,d6
  973.     cmp.b    #10,d6        ; window full ?
  974.     bne    .Label1
  975.     rts
  976.     
  977.  
  978. .AdjustGadgets    moveq.l    #9,d0
  979.     lea.l    .Gadget1(pc),a0
  980.     move.l    .WindowPointer(pc),a1
  981. .Loop1    move.w    gg_LeftEdge(a0),d1
  982.     add.b    wd_BorderLeft(a1),d1
  983.     move.w    d1,gg_LeftEdge(a0)
  984.  
  985.     move.w    gg_TopEdge(a0),d1
  986.     add.b    wd_BorderTop(a1),d1
  987.     move.w    d1,gg_TopEdge(a0)
  988.     
  989.     move.w    gg_Width(a0),d1
  990.     sub.b    wd_BorderRight(a1),d1
  991.     sub.w    gg_LeftEdge(a0),d1
  992.     move.w    d1,gg_Width(a0)
  993.     
  994.     move.l    (a0),a0
  995.     dbra    d0,.Loop1
  996.     rts    
  997.  
  998. .RestoreGadgets            ; restore default gadget position & size
  999.     moveq.l    #0,d0
  1000.     lea.l    .Gadget1(pc),a0
  1001. .Loop2    move.w    #0,gg_LeftEdge(a0)
  1002.     move.w    d0,gg_TopEdge(a0)
  1003.     move.w    #220,gg_Width(a0)
  1004.     move.w    #10,gg_Height(a0)
  1005.     move.l    (a0),a0
  1006.     add.w    #10,d0
  1007.     cmp.w    #10*10,d0
  1008.     bne.s    .Loop2
  1009.     rts    
  1010.     
  1011.  
  1012. .WindowData    dc.w    (640-220)/2,(200-(100+11+1))/2
  1013.     dc.w    220,100+11+1+3
  1014.     dc.b    -1,-1
  1015.     dc.l    VANILLAKEY!CLOSEWINDOW!GADGETUP
  1016.     dc.l    WINDOWCLOSE!SMART_REFRESH!ACTIVATE!RMBTRAP!WINDOWDRAG
  1017.     dc.l    0
  1018.     dc.l    0
  1019.     dc.l    .Name
  1020. .Screen    dc.l    0
  1021.     dc.l    0
  1022.     dc.w    160,100+11+1
  1023.     dc.w    160,100+11+1
  1024.     dc.w    WBENCHSCREEN
  1025. .Name    dc.b    "Please select :           ",0
  1026.     even
  1027. .WindowPointer    dc.l    0
  1028.  
  1029. FM_GADGET    macro
  1030.     dc.l    \1
  1031.     dc.w    4,\2*10
  1032.     dc.w    220-1,10
  1033.     dc.w    GADGHCOMP,RELVERIFY,BOOLGADGET
  1034.     dc.l    0,0,0,0,0
  1035.     dc.w    \3
  1036.     dc.l    0
  1037.     endm
  1038.  
  1039. .Gadget1    FM_GADGET    .Gadget2,0,"1"
  1040. .Gadget2    FM_GADGET    .Gadget3,1,"2"
  1041. .Gadget3    FM_GADGET    .Gadget4,2,"3"
  1042. .Gadget4    FM_GADGET    .Gadget5,3,"4"
  1043. .Gadget5    FM_GADGET    .Gadget6,4,"5"
  1044. .Gadget6    FM_GADGET    .Gadget7,5,"6"
  1045. .Gadget7    FM_GADGET    .Gadget8,6,"7"
  1046. .Gadget8    FM_GADGET    .Gadget9,7,"8"
  1047. .Gadget9    FM_GADGET    .Gadget10,8,"9"
  1048. .Gadget10    FM_GADGET    0,9,"0"
  1049.  
  1050.  
  1051.  
  1052. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1053. ; ­­                     data section                       ­­
  1054. ; ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
  1055.  
  1056.  
  1057. Text_32    Macro
  1058. .label1\@    dc.b    \1
  1059. .label2\@    ds.b    32-(.label2\@-.label1\@)
  1060.     endm
  1061. Text_64    Macro
  1062. .label1\@    dc.b    \1
  1063. .label2\@    ds.b    64-(.label2\@-.label1\@)
  1064.     endm
  1065.  
  1066.     even
  1067.  
  1068. FMousePort    dcb.b    MP_SIZE,0
  1069.     even
  1070. Version    dc.b    "1.00"
  1071.     dc.l    0
  1072. SPEED    dc.w    4
  1073. Time    dc.l    4*50
  1074. LISTE    Text_32    <"1. NewShell">
  1075.     Text_64    <"run ",62,"NIL: NewShell">
  1076.     Text_32    <"2. NewShell">
  1077.     Text_64    <"run ",62,"NIL: NewShell">
  1078.     Text_32    <"3. NewShell">
  1079.     Text_64    <"run ",62,"NIL: NewShell">
  1080.     Text_32    <"4. NewShell">
  1081.     Text_64    <"run ",62,"NIL: NewShell">
  1082.     Text_32    <"5. NewShell">
  1083.     Text_64    <"run ",62,"NIL: NewShell">
  1084.     Text_32    <"6. NewShell">
  1085.     Text_64    <"run ",62,"NIL: NewShell">
  1086.     Text_32    <"7. NewShell">
  1087.     Text_64    <"run ",62,"NIL: NewShell">
  1088.     Text_32    <"8. NewShell">
  1089.     Text_64    <"run ",62,"NIL: NewShell">
  1090.     Text_32    <"9. NewShell">
  1091.     Text_64    <"run ",62,"NIL: NewShell">
  1092. ENDE    Text_32    <"0. Exit">
  1093.  
  1094.